<?php
	
		
	function getCompanyList()
	{
		global $db,$db_table_prefix; 
		
		$sql = "SELECT
companies.ArName,
companies.EnName,
companies.Active,
users.Email
FROM
companies
INNER JOIN users ON companies.comid = users.CID
where users.Rid =2";
		$result[]=$db->sql_fetchrowset($db->sql_query($sql));

		return ($result);
	}
	
	function getlastinsertid()
	{
	global $db,$db_table_prefix;
	$sql = "SELECT MAX(comid) comid FROM companies";
	
     $result=$db->sql_fetchrowset($db->sql_query($sql));

		return ($result[0]);
  }
	

	

?>